<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List,java.util.HashMap"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>请选择您要转移到的群组</title>
<style type="text/css">
.STYLE6 {
color:#FFFFFF;
font-size:13px;
text-align:center
}
.STYLE7 {
color:#336699;
font-family:"Arial","宋体";
font-size:12px;
line-height:130%;
}
body {
	background-image: url(images/bg2.gif);
	background-repeat: repeat;
}
</style>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var forward=0;
function choiceForward(id) {
	forward = id;
	document.getElementById("submit").disabled=false;
}
$(document).ready(function(){
	if(parent.tmpGroupId!=0){
		parent.arry[0]=parent.tmpGroupId;
		$("#submit").replaceWith('<input type="button" id="submit" value="确认" disabled="true" onClick="submit2()" />');
		parent.tmpGroupId=0;
	}
})
function submit() {
	$.post("moveToGroup",{"list":parent.arry.toString(),"temp":forward},function(data){
		window.parent.tb_remove();
		window.parent.getContact(0);
		window.parent.show_Message("批量转移联系人成功!","green");
	},"text");
}
function submit2() {
	$.post("moveToGroup",{"list":parent.arry.toString(),"temp":forward},function(data){
		window.parent.tb_remove();
		window.parent.getContact(0);
		window.parent.show_Message("转移联系人成功!","green");
	},"text");
}
</script>
</head>
<body>
<table width="100%" border="1" align="center" bordercolor="#FFFFFF" bgcolor="#000000">
  <tr bgcolor="#1e84b4" class="STYLE6">
    <td width="7%" align="center" bordercolor="#FFFFFF">选择</td>
    <td width="23%" align="center" bordercolor="#FFFFFF">群组名称</td>
    <td width="55%" align="center" bordercolor="#FFFFFF">群组描述</td>
    <td width="15%" align="center" bordercolor="#FFFFFF">现有人数</td>
  </tr>
	<%
		List<HashMap> groups = (List<HashMap>)session.getAttribute("groups");
		for(HashMap hm : groups){
	%>
  <tr bgcolor="#FFFFFF" class="STYLE7">
  	<td align="center" bordercolor="#FFFFFF"><input type="radio" name="id" onClick="choiceForward(<%=hm.get("groupId") %>)" /></td>
    <td align="center" bordercolor="#FFFFFF"><%=hm.get("groupName") %></td>
    <td align="center" bordercolor="#FFFFFF">&nbsp;<%=hm.get("describe") %>&nbsp;</td>
    <td align="center" bordercolor="#FFFFFF"><%=hm.get("count") %></td>
  </tr>
	<%
		}
	%>
  <tr bgcolor="#FFFFFF" class="STYLE7">
    <td align="center" bordercolor="#FFFFFF">&nbsp;</td>
    <td align="center" bordercolor="#FFFFFF"><input type="button" disabled="true" id="submit" value="确认" onClick="submit()" /></td>
    <td align="center" bordercolor="#FFFFFF">&nbsp;</td>
    <td align="center" bordercolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>